← Back
Editing: index376.js
import{A as e,k as l,W as a,h as s,b as t}from"./utils-lib.js?v=1765440387";import{_ as r}from"./index93.js?v=1765440387";import{c as n,s as o,r as i,e as p,p as c,q as u,v as d,B as v,y as m,z as f,x as h,A as x,F as y,a$ as g,C as b,M as w,D as _}from"./base-lib.js?v=1765440387";import{aw as k,av as j,au as C}from"./site.js?v=1765440387";import{l as T}from"./useController13.js?v=1765440387";import{u as S}from"./useStore10.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";import"./column.js?v=1765440387";import"./useStore11.js?v=1765440387";import"./useStore3.js?v=1765440387";import"./useController6.js?v=1765440387";import"./validator.js?v=1765440387";import"./useController5.js?v=1765440387";import"./useController4.js?v=1765440387";import"./useStore9.js?v=1765440387";const D={class:"p-[1.5rem]"},O={class:"ml-[.4rem] text-danger"},L={class:"max-h-[38rem] overflow-auto"},M={key:0,class:"flex justify-end"},R={class:"h-full overflow-auto bg-black text-white"},H=["innerHTML"],I=n({__name:"index",props:{compData:{type:Object,default:()=>{}}},emits:["close"],setup(n,{emit:I}){const{activeTabs:q,sslIsRefresh:N,testIsRefresh:z,encryptIsRefresh:A,otherIsRefresh:F}=o(S()),P=t(),U=n,B=I,E=i({}),W=i([]),X=i(!1),$=i("");i();const G=i([]),J=i(!1),K=i(""),Q=i([{text:"解析域名需要一定时间来生效,完成所以上所有解析操作后,请等待1分钟后再点击验证按钮"},{text:""},{text:"若您使用的是宝塔云解析插件,阿里云DNS,DnsPod作为DNS,可使用DNS接口自动解析"}]),V=i([{label:"解析域名",prop:"domain",showOverflowTooltip:!0},{label:"记录值",prop:"auth_value",showOverflowTooltip:!0,render(l,a){const s="dns"===E.value.auth_type?l.auth_value:l.file_path;return p("div",{class:"flex items-center"},[p("div",{class:"truncate w-[15rem]"},[s]),p("span",{class:"svgtofont-icon-copy ml-[4px] text-[#666] text-[1.6rem] w-[1.6rem] cursor-pointer",onClick:()=>e({value:s})},null)])}},{label:"类型",prop:"type",showOverflowTooltip:!0,render:(l,a)=>"dns"===E.value.auth_type?p("span",null,[l.type]):p("div",{class:"flex items-center"},[p("div",{class:"truncate w-[15rem]"},[l.content]),p("span",{class:"svgtofont-icon-copy ml-[4px] text-[#666] text-[1.6rem] w-[1.6rem] cursor-pointer",onClick:()=>e({value:l.content})},null)])},{label:"必需",prop:"must",width:100}]),Y=e=>{var l,a;let s="";if(void 0===e[1].challenges)s+="<p><span>响应状态:</span>"+e[1].status+"</p>",s+="<p><span>错误类型:</span>"+e[1].type+"</p>",s+="<p><span>错误来源:</span><a class='bt-link' href='https://letsencrypt.org/' target='_blank' rel='noreferrer noopener'>Let's Encrypt官网</a></p>",s+='<div class="flex flex-col">错误代码:<pre class="!text-white !bg-[#333] !inline-block ! ml-[4px] ">'+e[1].detail+"</pre></div>";else if(e[1].challenges[1]||e[1].challenges[0]&&(e[1].challenges[1]=e[1].challenges[0]),"invalid"===e[1].status){let t="";for(let s=0;s<W.value.length;s++){if(-1==(null==(l=W.value[s].outerText)?void 0:l.indexOf(e[1].identifier.value)))continue;let r=null==(a=W.value[s].outerText)?void 0:a.split("\t");if((null==r?void 0:r.length)>1){t=r[1];break}}if(s+="<p><span>验证域名:</span>"+e[1].identifier.value+"</p>","dns"===E.value.type){s+="<p><span>验证解析:</span>"+("_acme-challenge."+e[1].identifier.value)+"</p>",s+="<p><span>验证内容:</span>"+t+"</p>",s+='<div class="flex flex-col">错误代码:<pre class="!text-white !bg-[#333] !inline-block ! ml-[4px] ">'+e[1].challenges[1].error.detail+"</pre></div>"}else{s+="<p><span>验证URL:</span><a class='bt-link' href='"+("http://"+e[1].identifier.value+"/.well-known/acme-challenge/"+e[1].challenges[0].token)+"' target='_blank' rel='noreferrer noopener'>点击查看</a></p>",s+="<p><span>验证内容:</span>"+e[1].challenges[0].token+"</p>",s+='<div class="flex flex-col">错误代码:<pre class="!text-white !bg-[#333] !inline-block ! ml-[4px] ">'+e[1].challenges[0].error.detail+"</pre></div>"}s+="<p><span>验证结果:</span> <a style='color:red;'>验证失败</a></p>"}P.msg({customClass:"bt-message-error-html",dangerouslyUseHTMLString:!0,icon:"x",message:'<div class="flex items-center justify-center mt-[8px] mb-[20px]"><i class="svgtofont-el-circle-close-filled mr-[8px] text-[#F56C6C] text-[3rem]"></i><a style="color: red;font-size:16px">'+e[0]+'</a></div><div class=" p-[20px] border border-1 border-color-[#dedede] ! rounded-[4px] ! mb-[12px] !leading-[26px] bg-[#f8f8f8]">'+s+"</div>",showClose:!0,duration:0})},Z=async()=>{var e;try{X.value=!0;const l=await T(),{data:a}=await k({index:E.value.index});if(l._props.onCancel(),X.value=!1,!0===a.status){const l={ssl:()=>N.value=!0,test:()=>z.value=!0,encrypt:()=>A.value=!0,other:()=>F.value=!0};null==(e=l[q.value])||e.call(l),B("close")}else{if("string"==typeof(null==a?void 0:a.msg))return P.error(a.msg);Y(a)}}catch(l){}};return c(()=>{(async e=>{var l,a;let s=null;try{s=P.load("正在验证证书申请状态,请稍后...");const t=await C({index:e.index});t.status?(G.value=t.data.auths,t.data.hasOwnProperty("error")?(J.value=t.data.error,K.value=t.data.error_msg):(J.value=!1,K.value=""),E.value=e,V.value[1].label="dns"===e.auth_type?"记录值":"文件路径",V.value[1].prop="dns"===e.auth_type?"auth_value":"file_path",V.value[2].label="dns"===e.auth_type?"类型":"文件内容",V.value[2].prop="dns"===e.auth_type?"type":"content",Q.value[1].text="可通过CMD命令来手动验证域名解析是否生效: nslookup -q=txt _acme-challenge.".concat(null==(a=null==(l=W.value[0])?void 0:l.domain)?void 0:a.replace("*.",""))):(P.request(t),B("close"))}catch(t){}finally{s&&s.close()}})(U.compData.row)}),(e,t)=>{const n=l,o=_,i=r,c=a,k=s;return u(),d("div",D,[t[2]||(t[2]=v(" 请按以下列表做TXT解析: ",-1)),m("span",O,f(h(K)),1),p(i,null,{content:x(()=>[m("div",L,[(u(!0),d(y,null,g(h(G),(e,l)=>(u(),d(y,null,[e.data.length?(u(),d("div",{key:l},[m("span",null,"验证域名:"+f(e.domain),1),p(n,{class:"my-[1rem]",column:h(V),data:e.data},null,8,["column","data"]),h(J)?(u(),d("div",M,[p(o,{type:"default",onClick:l=>(async e=>{try{X.value=!0;const l=await T(),{data:a}=await j({index:E.value.index,domain:e});if(l._props.onCancel(),X.value=!1,"valid"===a.status)P.success("验证成功");else if(!0===a.status)B("close");else{if("string"==typeof(null==a?void 0:a.msg))return P.error(a.msg);Y(a)}}catch(l){}})(e.domain)},{default:x(()=>[...t[0]||(t[0]=[v("验证",-1)])]),_:1},8,["onClick"])])):b("",!0)])):b("",!0)],64))),256))])]),"footer-right":x(()=>[h(J)?b("",!0):(u(),w(o,{key:0,type:"primary",onClick:Z},{default:x(()=>[...t[1]||(t[1]=[v("验证",-1)])]),_:1}))]),_:1}),p(c,{list:h(Q),listStyle:"disc",class:"ml-[2rem]"},null,8,["list"]),p(k,{visible:h(X),area:[50,25],"show-close":!1},{default:x(()=>[m("div",R,[m("pre",{innerHTML:h($),class:"whitespace-pre-wrap p-[1rem]"},null,8,H)])]),_:1},8,["visible"])])}}});export{I as default};
Save File
Cancel